package com.zhangbo.study.designpatternlearning.exterior;

/**
 * 外观对象，将多个不同的被操作对象复杂操作封装成简单的操作，对外暴露简单的接口
 * 如：
 * 回家，执行：开门、开灯
 * 出门，执行：关灯，关门
 */
public class UserExterior {

    private Door door;

    private Light light;

    public UserExterior(Door door, Light light) {
        this.door = door;
        this.light = light;
    }

    public void getHome() {
        door.openDoor();
        light.lightOn();
    }

    public void goOut() {
        light.lightOff();
        door.closeDoor();
    }

}
